From: Andrew Cooper Date: Mon, 28 May 2018 14:19:05 +0000 (+0000) Subject: x86/vmx: Don't clobber %dr6 while debugging state is lazy X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3574 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3cdac2805692c7accde2f405d81cc0be799aee48;p=xen.git x86/vmx: Don't clobber %dr6 while debugging state is lazy c/s 4f36452b63 introduced a write to %dr6 in the #DB intercept case, but the guests debug registers may be lazy at this point, at which point the guests later attempt to read %dr6 will discard this value and use the older stale value. Signed-off-by: Andrew Cooper Reviewed-by: Roger Pau Monné Acked-by: Kevin Tian --- diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index c261d2a781..bcf95f9a5f 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -3774,6 +3774,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs) */ __vmread(EXIT_QUALIFICATION, &exit_qualification); HVMTRACE_1D(TRAP_DEBUG, exit_qualification); + __restore_debug_registers(v); write_debugreg(6, exit_qualification | DR_STATUS_RESERVED_ONE); if ( !v->domain->debugger_attached ) {